package com.j2ee.struts.action;

import com.j2ee.service.BussinessService;
import com.j2ee.service.impl.BussinessServiceImpl;
import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class CustomerAction extends ActionSupport{
	
	private BussinessService bussinessService = new BussinessServiceImpl() ;
	
	public String add() {
		try {
			bussinessService.add() ;
			return SUCCESS ;
		} catch (Exception e) {
			e.printStackTrace() ;
			return ERROR ;
		}
	}
	
	public String edit() {
		try {
			bussinessService.edit() ;
			return SUCCESS ;
		} catch (Exception e) {
			e.printStackTrace() ;
			return ERROR ;
		}
	}
	
	public String delete() {
		try {
			bussinessService.delete() ;
			return SUCCESS ;
		} catch (Exception e) {
			e.printStackTrace() ;
			return ERROR ;
		}
	} 
	
	public String find() {
		try {
			bussinessService.find() ;
			return SUCCESS ;
		} catch (Exception e) {
			e.printStackTrace() ;
			return ERROR ;
		}
	}
	

}
